﻿namespace com.crownpack.InitiativesDao
{
    using System;

    using Microsoft.SharePoint;

    public partial class InitiativesConfiguration
    {
        #region Fields

        string _ClientSiteDescription;
        string _ClientSiteUrl;
        string _SourceListUrl;

        #endregion Fields

        #region Properties

        public string ClientSiteDescription
        {
            get
            {
                if ( string.IsNullOrEmpty( _ClientSiteDescription ) )
                {
                    string[ ] s = ClientSite.Split( ',' );
                    if ( s.Length >= 1 )
                        _ClientSiteDescription = s[ 1 ].Trim( );
                    //if ( ClientSite != null )
                    //    _ClientSiteDescription = ClientSite.Description;
                }
                return _ClientSiteDescription;
            }
            set
            {
                _ClientSiteDescription = value;
            }
        }

        public string ClientSiteUrl
        {
            get
            {
                if ( string.IsNullOrEmpty( _ClientSiteUrl ) )
                {
                    string[ ] s = ClientSite.Split( ',' );
                    if ( s.Length >= 1 )
                        _ClientSiteUrl = s[ 0 ].Trim( );
                    //if ( ClientSite != null )
                    //    _ClientSiteUrl = ClientSite.Url;
                }
                return _ClientSiteUrl;
            }
            set
            {
                _ClientSiteUrl = value;
            }
        }

        #endregion Properties

        #region Other

        //SPFieldUrlValue _clientSite;
        //[Microsoft.SharePoint.Linq.ColumnAttribute( Name = "cpClientSite", Storage = "_clientSite", FieldType = "Url" )]
        //public SPFieldUrlValue ClientSite
        //{
        //    get
        //    {
        //        return this._clientSite;
        //    }
        //    set
        //    {
        //        if ( ( value != this._clientSite ) )
        //        {
        //            this.OnPropertyChanging( "ClientSite", this._clientSite );
        //            this._clientSite = value;
        //            this.OnPropertyChanged( "ClientSite" );
        //        }
        //    }
        //}

        #endregion Other
    }
}